// Generated from <%= script_name %>

package <%= package_name %>;

import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.shopify.graphql.support.AbstractResponse;
import com.shopify.graphql.support.Arguments;
import com.shopify.graphql.support.Error;
import com.shopify.graphql.support.Query;
import com.shopify.graphql.support.SchemaViolationError;
import com.shopify.graphql.support.TopLevelResponse;
import com.shopify.graphql.support.Input;
<% imports.each do |import| %>
  import <%= import %>;
<% end %>

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

public class Operations {
    <% [[:query, schema.query_root_name], [:mutation, schema.mutation_root_name]].each do |operation_type, root_name| %>
        <% next unless root_name %>
        public static <%= root_name %>Query <%= operation_type %>(<%= root_name %>QueryDefinition queryDef) {
            StringBuilder queryString = new StringBuilder("<%= operation_type unless operation_type == :query %>{");
            <%= root_name %>Query query = new <%= root_name %>Query(queryString);
            queryDef.define(query);
            queryString.append('}');
            return query;
        }
    <% end %>
}
